﻿//-----------------------------------------------------------------------
// <copyright file="DTOOffer.cs" company="Transilvania University of Brasov">
//     Copyright (c) Nagy Robert. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DomainModel
{
    using System.ComponentModel.DataAnnotations;
    using Enums;
    using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

    /// <summary>
    /// Describes an Offer entity.
    /// </summary>
    public class DTOOffer
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the bidder.
        /// </summary>
        [NotNullValidator(ErrorMessage = "Bidder cannot be null.")]
        public DTOBidder Bidder { get; set; }

        /// <summary>
        /// Gets or sets the product.
        /// </summary>
        [NotNullValidator(ErrorMessage = "Product cannot be null.")]
        public DTOProduct Product { get; set; }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        [RangeValidator(typeof(decimal), "0.00", RangeBoundaryType.Exclusive, "0.00", RangeBoundaryType.Ignore, ErrorMessage = "Id must be at greater than {3}.")]
        public decimal Value { get; set; }

        /// <summary>
        /// Gets or sets the currency.
        /// </summary>
        public ECurrency Currency { get; set; }
    }
}
